/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-05-22
 * Time: 14:23
 */

class Student{
    //成员变量，属性
    private String name;
    private int age;
    private String StuNum;
//成员方法
    public static String StuClass;

    public String getName(){
        return this.name;
    }


    public void setName(String name){
        this.name = name;
    }




    public void eat(){
        System.out.println(name + "吃饭");
    }
    public void doclass(){
        System.out.println(name + "做作业");
    }

    public Student(String name, int age, String stuNum) {
        this.name = name;
        this.age = age;
        this.StuNum = stuNum;
    }

    //构造方法
    public Student(){
        this("zhangsan",18,"125456");
        System.out.println("不带参数的构造方法");
    }
  /*  public Student(String name, int age, String StuNum){
        this.name = name;
        this.age = age;
        this.StuNum = StuNum;
        System.out.println("调用了带有3个参数的构造方法");
    }*/
}


public class Test {
    public static void main1(String[] args) {
        Student student2 = new Student();
        student2.setName("zhangsan");
        System.out.println(student2.getName());
        Student student1 = new Student("zhangsan1", 148, "555555");
    }

 /*   public static void main(String[] args) {
        TestDemo testDemo = new TestDemo();
        testDemo.test();*/
 public static void main(String[] args) {
     Student student1 = new Student("zhagnsan",11,"12345");
     Student.StuClass = "一班";
     Student student2 = new Student("lisi0",14,"123568");
 }
    }
    //对象的实例化
    /*public static void main1(String[] args) {
        Student student1 = new Student();
        student1.name = "zhagnsan";
        student1.age = 15;
        student1.StuNum = "20240510";
        student1.eat();
        student1.doclass();
    }*/

